<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('username')->unique()->comment('用户名');
            $table->string('password')->nullable()->comment('密码');
            $table->string('nickname')->nullable()->comment('昵称');
            $table->string('avatar')->nullable()->comment('头像');
            $table->string('phone', 20)->nullable()->comment('手机号');
            $table->tinyInteger('gender')->default(0)->comment('性别 0 未知 1 男 2 女');
            $table->date('birthday')->nullable()->comment('生日');
            $table->string('address')->nullable()->comment('地址');
            $table->string('company')->nullable()->comment('公司');
            $table->string('job')->nullable()->comment('职位');
            $table->string('wechat')->nullable()->comment('微信');
            $table->string('qq')->nullable()->comment('QQ');
            $table->string('email')->nullable()->unique()->comment('邮箱');
            $table->timestamp('email_verified_at')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
